package com.upf1sh.controller;


import com.upf1sh.bean.SensorData;
import com.upf1sh.service.SensorDataService;
import com.upf1sh.utils.Result;
import com.upf1sh.vo.PageVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/sensorData")
public class SensorDataController {

    @Autowired
    private SensorDataService sensorDataService;

    @GetMapping("/selectSensorData")
    public Result selectSensorData(Integer pageNumber,Integer pageSize) {
        PageVO pageVO = sensorDataService.selectSensorData(pageNumber,pageSize);

        return Result.ok().data("data",pageVO);
    }


    @PostMapping
    public Result get() {
        boolean b = sensorDataService.get();
        if(b){

            return Result.ok();
        }else {
            return Result.error();
        }
    }








}
